package com.hzsun.redis.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @Author: DingJl
 * @Date: 2022/1/26 10:50
 * @Version 1.0
 */
@Component
public class RedisServiceImpl  implements  RedisService{

    @Autowired
    private  RedisTemplate redisTemplate;
    @Override
    public void set(String key, Object value) {
        redisTemplate.opsForValue().set(key,value);
    }

    @Override
    public Object get(String key) {
        return  redisTemplate.opsForValue().get(key);
    }
}
